<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type = "button" value= "点我一下">
</body>
<script>
    //事件：
        //1.事件源
        let button = document.querySelector("input");
        //2.绑定事件类型(onclick)
        //3.函数设置事件处理程序(function())
        button.onclick = function(){
            alert("你好！");
        }
</script>
</html>